import random

# d={1:'cat',2:'dog',3:'book'}
# print(d)
#
# lst1=[1,2,3]
# lst2=['cat','dog','book']
# d=zip(lst1,lst2)
# print(d) #<zip object at 0x000001D42BDE3EC0>
# # print(list(d)) #[(1, 'cat'), (2, 'dog'), (3, 'book')]
# d=dict(d)
# print(d) #{1: 'cat', 2: 'dog', 3: 'book'}
#
# for key,value in d.items():
#     print(key,value)
#
# #生成式
#
d={item:random.randint(1,100) for item in range(4)}
print(d)
#
lst1=[1,2,3]
lst2=['cat','dog','book']
d={key:value for key,value in zip(lst1,lst2)}
print(d)
lst1.extend([4,5])#将传入序列的元素添加进序列
lst1.append([6,7])#将传入序列作为一个元素加入序列
print(lst1)


